# Maintainer: Eivind Uggedal <eu@eju.no>
pkgname=py3-redis
_pkgname=redis
pkgver=4.1.0
pkgrel=0
pkgdesc="Python3 client for Redis key-value store"
url="https://github.com/andymccurdy/redis-py"
arch="noarch"
license="MIT"
depends="python3 py3-deprecated py3-hiredis"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-mock redis"
source="
	https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	0001-all-remove-support-for-nonfree-Redis-modules.patch
	0002-Drop-tests-test_ssl.py.patch
"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-redis" # Backwards compatibility
provides="py-redis=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() (
	redis-server --dir "$builddir" &
	trap "kill $!" EXIT
	pytest
)

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
85cd09570f4faf34a735befd0677aa8ca2cb0d62b0285c4c040380c2440f2774e47762ec4219381294465343353a15804b96f06b4d6eefa7159a224eb9e72001  redis-4.1.0.tar.gz
b1dd96aeb6129f121108fac3c1ad033b1b657287fb0f959bc7fcab997b26c4b91cc7c0df6f86d6d2ac283951956a4a38826647f0e744514ce5031cf3917d1746  0001-all-remove-support-for-nonfree-Redis-modules.patch
5184efc472ad16020240e57222f906656b1f6db5139d37de22b34298c7a15c9b91f5c2d976f6c8455071459d2ff273f75f6bf76f3f46990bacec6673a83a2872  0002-Drop-tests-test_ssl.py.patch
"
